﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace Trans.car
{
    public partial class Select_car : Form
    {
        public int Id{
            get{
                return (int)gv_cars.SelectedRows[0].Cells["id"].Value;
            }
        }
        public string CarLicense
        {
            get{
                return (string)gv_cars.SelectedRows[0].Cells["license"].Value;
            }
        }
        public bool HasSelected
        {
            get
            {
                if (gv_cars.SelectedRows.Count > 0)
                    return true;
                else
                    return false;
            }
        }
        public Select_car()
        {
            InitializeComponent();
        }

        private void Select_car_Load(object sender, EventArgs e)
        {
            // TODO: 这行代码将数据加载到表“dataSet_view.vw_car”中。您可以根据需要移动或移除它。
            this.vw_carTableAdapter.Fill(this.dataSet_view.vw_car);

        }

        private void gv_cars_CellContentClick(object sender, DataGridViewCellEventArgs e)
        {
            
        }

        private void bt_save_Click(object sender, EventArgs e)
        {
            this.Close();
        }

        private void bt_cancel_Click(object sender, EventArgs e)
        {
            this.Close();
        }

        private void gv_cars_DataBindingComplete(object sender, DataGridViewBindingCompleteEventArgs e)
        {
            session.Color_Const.set_gv_color(gv_cars);
        }
    }
}
